package test.pcs;

import clojure.lang.Var;
import com.payment.lc.pcs.client.wrap.bo.ProductionALLAttributes;
import com.payment.lc.pcs.client.wrap.bo.ProductionPurchaseAttributes;
import com.payment.lc.pcs.client.wrap.service.ProductionWrapService;
import com.payment.lc.pcs.service.api.DynamicDataService;
import com.payment.lc.pcs.service.api.NoticeService;
import com.payment.lc.pcs.service.api.ProductionService;
import com.payment.lc.pcs.service.api.fund.JMFundService;
import com.payment.lc.pcs.service.bo.ProductionSellInfo;
import com.payment.lc.pcs.service.bo.ProductionValue;
import com.payment.lc.pcs.service.domain.*;
import com.payment.lc.pcs.service.request.FundTopicRequest;
import com.payment.lc.pcs.service.request.GetFundListReq;
import com.payment.lc.pcs.service.response.FundTopicResp;
import com.payment.lc.pcs.service.response.GetFundListResp;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import test.BaseTest;

import java.util.List;

/**
 * Created on 2016/8/8.
 */
public class Demo3PcsClient9Test1 extends BaseTest {

    @Autowired
    ProductionService productionService;

    @Autowired
    ProductionWrapService productionWrapService;

    @Autowired
    NoticeService noticeService;

    @Autowired
    JMFundService jmFundService;
    @Autowired
    DynamicDataService dynamicDataService;


    @Test
    public void test() {
        test11();
    }

    void test11(){
        String prodCode = "JM002324";
        ProductionPurchaseAttributes purchaseAttributes = productionWrapService.getProductionPurchaseAttributes(productionWrapService.getProduction(prodCode));
        display(purchaseAttributes);

    }

    void test10() {
        String prodCode = "JM001709";
        FundsProductionV2 fundsV2 = productionService.getFundsV2(prodCode);
        display(fundsV2);
    }
    void test6() {
        String prodCode = "FI16020";
        Production production = productionWrapService.getProduction(prodCode);
        List<MaintainInfo> maintainList = productionWrapService.getPurchaseMaintainList(production);
        display(maintainList);
    }

    void test8() {
        String prodCode = "FI16020";
        Production production = productionWrapService.getProduction(prodCode);
        ProductionALLAttributes allAttributes = productionWrapService.getProductionALLAttributes(production);
        display(allAttributes);
    }

    void test7() {
        String prodCode = "FI16020";
        ProductionSellInfo sellInfo = dynamicDataService.getProductionSellInfo(prodCode);
        display(sellInfo);
    }

    void test5() {
        String fundProdCode = productionService.getFundProdCode("S883", "J101");
        System.out.println("fundProdCode = " + fundProdCode);
    }

    void test1() {
        FundTopicRequest request = new FundTopicRequest();
        request.setStart(0);
        request.setLimit(5);
        FundTopicResp resp = jmFundService.getFundTopicBos(request);
        display(resp);
    }

    void test4() {
        String prodCode = "JM161714";
        Production production = productionWrapService.getProduction(prodCode);
        ProductionALLAttributes attributes = productionWrapService.getProductionALLAttributes(production, false);
        display(attributes);
    }

    void test3() {
        noticeService.getNoticesByProductionCode("JM001666");
    }

    void test2() {
        String prodCode = "00007";
        Production production = productionWrapService.getProduction(prodCode);
        display(production);
    }
}